package com.tz.web.book;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tz.bean.Course;
import com.tz.bean.TzParams;
import com.tz.core.BaseController;
import com.tz.service.course.ICourseService;

@RequestMapping("/stage")
@Controller
public class SCourseController extends BaseController{

	@Autowired
	private ICourseService courseService;
	
	@ResponseBody
	@RequestMapping(value="/listcourse",method=RequestMethod.POST)
	public List<Course> listCourse(TzParams params){
		params.setIsDelete(1);
		params.setStatus(1);
		int count = courseService.count(params);
		List<Course> courses = courseService.listCourses(params);
		session.setAttribute("count", count);
		return courses;
	}
}
